classdef PAR_dev < Processor_dev
  % Class for calculating PAR ala SBE Data Procesing
  % Derived from Processor
  % Constructor signature: par = PAR_dev(data, conn), args. optional
  %
  % Author: David Goldsmith, Wash. State Dept. of Ecology, dgol461@ecy.wa.gov
  % Release date: N/A
  
    properties
      % inherited from Processor_dev
%         inData;
%         castDT;
%         scanRate;
%         ParamID;
%         ParamDesc;
%         SBEprec;
%         EquipID;
        DBdata;
        outData;
    end
    
    methods
        function par = PAR_dev(data, conn) % Constructor
            if nargin < 1, data = []; end
            if nargin < 2, conn = []; end
            par = par@Processor_dev(data);
            if ~isempty(conn), par.getDBdata(conn, 'R'); end
            if ~isempty(conn) && ~isempty(data), par.mainFormula(); end
        end
        
        function delete(obj) % Destructor
            % Here in case I need it
        end
        
        function mainFormula(obj)
            M = obj.inData.Sensors.PAR_BiosphericalLicorChelseaSensor.M;
            B = obj.inData.Sensors.PAR_BiosphericalLicorChelseaSensor.B;
            C = obj.inData.Sensors.PAR_BiosphericalLicorChelseaSensor. ...
                    CalibrationConstant;
            A = obj.inData.Sensors.PAR_BiosphericalLicorChelseaSensor. ...
                    Multiplier;
            D = obj.inData.Sensors.PAR_BiosphericalLicorChelseaSensor. ...
                    Offset;
            V = obj.inData.rV(:,obj.inData.Sensors. ...
                                PAR_BiosphericalLicorChelseaSensor.index-2);
            obj.outData = D + A/C * 10.0 .^ (((V-B)/M) + 9);
        end
        
    end
    
end